package middleware

import (
	"github.com/cloudwego/hertz/pkg/app/server"
	"github.com/hertz-contrib/cors"
)

func InitCors(h *server.Hertz) {
	h.Use(cors.New(
		cors.Config{
			AllowAllOrigins:        true,
			AllowOrigins:           nil,
			AllowOriginFunc:        nil,
			AllowMethods:           nil,
			AllowHeaders:           nil,
			AllowCredentials:       false,
			ExposeHeaders:          nil,
			MaxAge:                 0,
			AllowWildcard:          false,
			AllowBrowserExtensions: false,
			AllowWebSockets:        false,
			AllowFiles:             false,
		},
	))
}
